<include file='Admin/Tpl/Public/nav.html' />
<!-- BEGIN SIDEBAR RIGHT HEADING -->
            <div class="sidebar-right-heading">
                <ul class="nav nav-tabs square nav-justified">
                  <li class="active"><a href="#online-user-sidebar" data-toggle="tab"><i class="fa fa-comments"></i></a></li>
                  <li><a href="#notification-sidebar" data-toggle="tab"><i class="fa fa-bell"></i></a></li>
                  <li><a href="#task-sidebar" data-toggle="tab"><i class="fa fa-tasks"></i></a></li>
                  <li><a href="#setting-sidebar" data-toggle="tab"><i class="fa fa-cogs"></i></a></li>
                </ul>
            </div><!-- /.sidebar-right-heading -->

            <!-- BEGIN PAGE CONTENT -->
            <div class="page-content">
                <div class="container-fluid">
                    <!-- Begin page heading -->
                    <h1 class="page-heading">Team In <small>请假管理</small></h1>
                    <!-- End page heading -->
                
                    <!-- Begin breadcrumb -->
                    <ol class="breadcrumb default square rsaquo sm">
                        <li><a href="index.html"><i class="fa fa-home"></i></a></li>
                        <li><a href="#fakelink">Teamin</a></li>
                        <li class="active">请假列表(点击请假编号查看详情)</li>
                    </ol>
                    <!-- End breadcrumb -->                 
                    <!-- Begin table with avatar -->
                    <h5 class="small-title">请假列表</h5>                  
                    <!-- Begin example member table -->
                    <div class="the-box no-border leave-log">                  
                        <div class="btn-toolbar top-table div1" role="toolbar">
                            <div class="btn-group groups">
                                    <span type="button" class="btn btn-danger">请假列表</span>
                            </div>
                            <div class="btn-group groups">
                                <span type="button" class="btn btn-success" ><a style="color:white;font-weight:bold" href="__APP__/HomePage/Leave_excel">Excel文件导出</a></span>
                            </div>                            
                            <div class="btn-group pull-right">
                    <!--搜索-->
                            <input style="float:right;height:27px;line-height:14px;" type="submit" id="search_btn" class="btn btn-primary" style="height:28px;line-height:14px;" value="搜索" />
                            <input style="float:right;margin-left:5px" id="search_name" type="text" placeholder="按姓名查询...">
                            <input style="float:right;" id="search_time" type="text" placeholder="按开始时间查询..." name="project_startTime" value=""  onClick="WdatePicker()" />
                             
                            </div><!-- /.btn-group .pull-right -->
                        </div><!-- /.btn-toolbar top-table -->
                        
                        <div class="table-responsive div1 div_search">
                            <table class="table table-th-block table-hover">                                
                                <thead>
                                    <tr>
                                        <th class="text_content" style="width:60px">编号</th>
                                        <th class="text_content" style="text-align:center">类型图片</th>
                                        <th class="text_content" style="text-align:center">类型名称</th>
                                        <th class="text_content" style="text-align:center">请假证明</th>
                                        <th class="text_content" style="text-align:center">操作</th> 
                                    </tr>                           
                                </thead>                                
                                <tbody>
                                    <foreach name="page" key="key" item="value">                                                                   
                                        <tr>
                                            <td class="text_content sub color_hover detail" style="text-align:center">{$value['type_id']}</td> 
                                            <td class="text_content" style="text-align:center"><img src="__ROOT__/{$value['type_image_s']}" width="44" height="44" /></td>
                                            <td style="text-align:center">{$value['type_name']}</td>                            
                                            <td class="text_content" style="text-align:center;word-break:break-all">
                                            	<if condition="$value['type_prove'] eq 1">
                                               	需要
                                                <else/>
                                                不需要
                                                </if>
                                            </td>
                                            <td class="text_content state" style="text-align:center">
                                            	<a href="__URL__/update_type?type_id={$value.type_id}" >修改</a>&nbsp;|&nbsp;
                                                <a href="__URL__/delete_type">删除</a>
                                            </td>                                           
                                        </tr>
                                    </foreach>
                                </tbody>
                            </table>
                            <ul class="pagination success">{$show}</ul>
                        </div>

                        <div class="table-responsive" id="hl"></div>

                    </div><!-- /.the-box -->
                    <!-- End example member table -->           
                </div><!-- /.container-fluid -->
            </div>
        </div>            
</body>
<script language="javascript" type="text/javascript" src="__PUBLIC__/Js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
//请假查询
$("#search_btn").click(function(){
    var name = $("#search_name").val();
    var time = $("#search_time").val();

    var page = 1;
    $.ajax({
        url:"__URL__/search",
        data:{"search":name,"time":time,"page":page},
        type:"post",
        success:function(data){
           //alert(data);
           $(".div_search").html(data);
        }
    });
});
    $(".current").css({background:"#8CC152",color:"white"});   
    for(var i=0;i<$(".state").length;i++){
        var state = $(".state:eq("+i+")").attr("name");      
        switch(state){
            case "0":
                $(".state:eq("+i+")").text("审批中");
            break;
            case "1":
                $(".state:eq("+i+")").text("已审批");
            break;
            case "2":
                $(".state:eq("+i+")").text("已驳回");
            break;
            case "3":
                $(".state:eq("+i+")").text("申请销假");
            break;
            case "4":
                $(".state:eq("+i+")").text("同意销假");
            break;
            case "5":
                $(".state:eq("+i+")").text("驳回销假");
            break;
        }
    }
//请假详情
 $(".detail").click(function(){
    var leave_id = $(this).attr("id");
    $.ajax({
        url:"__URL__/detail",
        data:{"leave_id":leave_id},
        type:"post",
        success:function(data){
            $('.leave-log').html(data);
        }
    });
 });   
</script>
<html>  